﻿using System;
using Transformable_Engine_v2.Engine.Graphics;
using Transformable_Engine_v2.Engine.Transformable_Math.Geometry;

namespace Super_Management_Mayhem.Content.Spritesheet
{
    public class UISheet : SpriteSheetInstance
    {
        private static SpriteSheetInstance _instance;
        public static void LoadContent()
        {
            _instance = new UISheet();
        }
        public new static Sprite GetSprite(Enum textureName)
        {
            return _instance.GetSprite(textureName);
        }
        public static SpriteSheetInstance GetInstance()
        {
            return _instance;
        }

        public enum AttackIcon
        {
            Sword,
            None,
        }

        public enum Hud
        {
            Point,
            Hourglass,
        }

        public enum PlayerIconContainer
        {
            Outline,
            Inside,
        }

        public enum PointAlphabet
        {
            Num0,
            Num1,
            Num2,
            Num3,
            Num4,
            Num5,
            Num6,
            Num7,
            Num8,
            Num9,
            Unknown,
            Colon,
        }

        public enum Countdown
        {
            Three,
            Two,
            One,
        }

        public enum LetterAlphabet
        {
            A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z,
            a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z,
            Unknown,
        }

        public enum Heart
        {
            Heart0,
            Heart1,
            Heart2,
            Heart3,
            Heart4,
            Heart5,
            Heart6,
            Heart7,
            Heart8,
            Heart9,
            Heart10,
            Heart11,
            Heart12,
            Heart13,
            Heart14,
            Heart15,
            Heart16,
            Heart17,
            Heart18,
            Heart19,
            Heart20,
            Dead,
        }

        public enum TimeUp
        {
            Title,
            Bubble
        }

        public override string SpriteSheetPath
        {
            get
            {
                return "Content/Images/UI.png";
            }
        }

        protected override void LoadSprites()
        {

            AddEnumList<PointAlphabet>(PointAlphabet.Num0, PointAlphabet.Unknown, new TE_Rectangle(0, 0, 1, 1));
            AddSprite(PointAlphabet.Colon, new TE_Rectangle(10, 1, 1, 1));

            AddSprite(Hud.Point, new TE_Rectangle(8, 4.5f, 2, 2));
            AddSprite(Hud.Hourglass, new TE_Rectangle(8, 6.5f, 2, 2));

            AddSprite(AttackIcon.None, new TE_Rectangle(11, 0, 2, 2));
            AddSprite(AttackIcon.Sword, new TE_Rectangle(13, 0, 2, 2));

            AddEnumList<Heart>(Heart.Heart0, Heart.Heart20, new TE_Rectangle(0, 2.5f, 2, 2));
            AddSprite(Heart.Dead, new TE_Rectangle(0, 4.5f, 2, 2));

            AddEnumList<PlayerIconContainer>(PlayerIconContainer.Outline, PlayerIconContainer.Inside, new TE_Rectangle(10, 4.5f, 2, 2));

            AddEnumList<LetterAlphabet>(LetterAlphabet.A, LetterAlphabet.Unknown, new TE_Rectangle(14, 4.5f, 0.5f, 1), 26);

            AddEnumList<Countdown>(Countdown.Three, Countdown.One, new TE_Rectangle(0, 8.5f, 8, 8));

            AddSprite(TimeUp.Title, new TE_Rectangle(27, 4.5f, 22.5f, 3.75f));
            AddSprite(TimeUp.Bubble, new TE_Rectangle(24, 8.5f, 8, 8));
        }
    }
}